From 6b01ddb1b445045696d1b3f70d644be77e1f03b4 Mon Sep 17 00:00:00 2001 From: Sergio Costas Rodriguez Date: Wed, 4 Mar 2026 12:35:52 +0100 Subject: [PATCH] appDisplay: Fix accessibility for application folders Currently, application folders have a `checkbutton` role, which is confusing for the user because it's not something that changes its checked status, but a button that opens the contents of the folder. Also, the only indication that this is a folder and not a "normal" application is that role, which means that an user must know that pushbuttons are applications and checkbuttons are folders, which is confusing. This patch fixes this by adding the "expandable" accessible state to the folder button, thus notifying the user that it is an element with extra elements inside. It also adds the folder name and the type as the full container label when opening a folder, thus ensuring that the user knows where they are. Part-of: --- js/ui/appDisplay.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index 20c133d7f..4ecaf92af 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -1,3 +1,4 @@ +import Atk from 'gi://Atk'; import Clutter from 'gi://Clutter'; import Cogl from 'gi://Cogl'; import GLib from 'gi://GLib'; @@ -2278,6 +2279,9 @@ export const FolderIcon = GObject.registerClass({ button_mask: St.ButtonMask.ONE, can_focus: true, }, global.settings.is_writable('app-picker-layout')); + + this.add_accessible_state(Atk.StateType.EXPANDABLE); + this._id = id; this._name = ''; this._parentView = parentView; @@ -2437,6 +2441,11 @@ export const FolderIcon = GObject.registerClass({ mode, delay: isOpen ? 0 : FOLDER_DIALOG_ANIMATION_TIME - duration, }); + + if (isOpen) + this.add_accessible_state(Atk.StateType.EXPANDED); + else + this.remove_accessible_state(Atk.StateType.EXPANDED); }); } } @@ -2453,6 +2462,8 @@ export const AppFolderDialog = GObject.registerClass({ x_expand: true, y_expand: true, reactive: true, + accessible_name: source.name, + accessible_role: Atk.Role.PANEL, }); this.add_constraint(new Layout.MonitorConstraint({primary: true})); -- 2.39.5